<template>
  <div id="manage-edit-comment">
    <BlogTabs :list="list">
      <template v-slot:comment>
        <div>
          <span @click="selectExamine" :class="[examine ? 'active' : '', 'examine']">我的文章评论</span>
          <span @click="selectWaitExamine" :class="[examine ? '' : 'active', 'waitExamine']">待我审核的评论</span>
        </div>
        <div class="comment-list" v-show="examine">
          <el-card shadow="hover" v-for="o in 4" :key="o">
            <span class="comment-title">文章标题</span>
            <div class="comment-content">
              <icon-svg class="leftMarks" name="leftMarks"></icon-svg>
              <span> 有用的话记得给我点赞哦 </span>
              <icon-svg class="rightMarks" name="rightMarks"></icon-svg>
            </div>
            <div class="comment-operation">
              <span class="revice">快速回复</span>
              <span>|</span>
              <span class="delete">删除</span>
            </div>
          </el-card>
        </div>
        <div class="comment-list" v-show="!examine">
          <el-card shadow="hover" v-for="o in 10" :key="o">
            <span class="comment-title">这是未审核过的文章评论</span>
            <div class="comment-content">
              <icon-svg class="leftMarks" name="leftMarks"></icon-svg>
              <span> 这是未审核过的评论 </span>
              <icon-svg class="rightMarks" name="rightMarks"></icon-svg>
            </div>
            <div class="comment-operation">
              <span @click="adoptComment" class="revice">通过</span>
              <span>|</span>
              <span class="delete">删除</span>
            </div>
          </el-card>
        </div>
      </template>
    </BlogTabs>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [
        {
          name: 'comment',
          label: '博客评论',
          id: 1
        }
      ],
      examine: true
    }
  },
  methods: {
    selectExamine() {
      this.examine = true
    },
    selectWaitExamine() {
      this.examine = false
    },
    adoptComment() {
      // 向后台发送数据
    }
  }
}
</script>

<style lang="scss">
#manage-edit-comment {
  .examine,
  .waitExamine {
    font-size: 14px;
    color: #555;
    margin-right: 25px;
    padding: 20px 0;
    cursor: pointer;
    &:hover {
      color: #222226;
    }
    &.active {
      font-weight: bold;
    }
  }
  .comment-list {
    // position: relative;
    width: 100%;
    margin-top: 20px;
    padding: 0 0 20px 20px;
    .el-card {
      position: relative;
      width: 95%;

      margin-bottom: 20px;
    }
    .comment-title {
      margin-left: 20px;
      font-size: 15px;
      color: #349edf;
    }
    .comment-content {
      margin-top: 20px;
      margin-left: 20px;
    }
    .leftMarks,
    .rightMarks {
      color: #555;
    }
    .comment-operation {
      position: absolute;
      right: 50px;
      top: 20px;
      & > span {
        margin-left: 20px;
      }
      .revice {
        color: #349edf;
        cursor: pointer;
      }

      .delete {
        cursor: pointer;
        color: rgb(252, 85, 49);
      }
    }
  }
}
</style>
